package com.luugiathuy.apps.remotebluetooth;

import java.util.ArrayList;

public class Macro {
	ArrayList<Action> actions;
	String actionList[];
	
	public Macro()
	{
		actions = new ArrayList<Action>();
		actionList = new String[20];
		for(int i=0; i<actionList.length;i++)
		{
			actionList[i] =" ";
		}
	}
	
	public void addAction(Action actAdd)
	{
		actions.add(actAdd);
		
	}
	
	public boolean removeAction(int index)
	{
		if(actions.remove(index)!=null)
			return true;
		else
			return false;
	}
	
	public String[] getActionList()
	{
		return actionList;
	}
	
	public void emptyActionList()
	{
		for(int i=0; i<actionList.length;i++)
		{
			actionList[i] =" ";
		}
		actions.clear();
	}
	
	public void reloadList()
	{
		for(int i=0; i<actionList.length; i++)
		{
			if(i<actions.size())
				if(actions.get(i) != null)
					actionList[i] = actions.get(i).print();
		}
	}
}
